package com.me.customerdemo.service.impl;

import com.me.customerdemo.dao.ProductMapper;
import com.me.customerdemo.pojo.Product;
import com.me.customerdemo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServerImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> selectAll() {
        return productMapper.selectAll();
    }

    @Override
    public boolean updateById(Product product) {
        return productMapper.updateById(product)>0? true:false;
    }

    @Override
    public boolean deleteById(int id) {
        return productMapper.deleteById(id)>0?true:false;
    }

    @Override
    public boolean apply(Product product) {
        return productMapper.apply(product)>0?true:false;
    }
}
